package com.buer.storage.business.service.impl;

import com.buer.storage.business.dao.ProdCategoryDao;
import com.buer.storage.business.domain.ProdCategory;
import com.buer.storage.business.dto.ProdCategoryDto;
import com.buer.storage.business.service.ProdCategoryService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

//装备分类管理
@Service
public class ProdCategoryServiceImpl implements ProdCategoryService {

    @Resource
    private ProdCategoryDao prodCategoryDao;

    //增加装备分类
    @Override
    public int add(ProdCategoryDto prodCategoryDto) {
        return prodCategoryDao.add(prodCategoryDto);
    }

    //删除装备分类
    @Override
    public int delete(int categoryId) {
        return prodCategoryDao.delete(categoryId);
    }

    //修改装备分类
    @Override
    public int update(ProdCategory prodCategory) {
        return prodCategoryDao.update(prodCategory);
    }

    //查询所有装备分类
    @Override
    public List<ProdCategory> select() {
        return prodCategoryDao.select();
    }

    //通过编号或者名字查询
    @Override
    public List<ProdCategory> selectByName(String categoryNumber, String categoryName) {
        return prodCategoryDao.selectByName(categoryNumber, categoryName);
    }
}
